package com.information.manage.basic.common.recycling;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Initial Heart
 * Date: 2022-03-06.
 * Description:
 * Version: V1.0
 */
@Component
public class RegisterBean {

    @Bean
    public RecoveryDataOperateManager manager(){
        return new RecoveryDataOperateManagerWrapper();
    }

    public static class RecoveryDataOperateManagerWrapper extends RecoveryDataOperateManager {

        @Override
        @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED, timeout = 36000, rollbackFor = Exception.class)
        public void deleteData(Class entityClass, List<Integer> ids) {
            super.deleteData(entityClass, ids);
        }

    }

}
